package com.link.auth.core.commonproperties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author HuangLJ
 * @date 2019-07-30 11:56
 * yml信息属性配置
 */

@Component
@Scope
public class YmlProperties {


    //是否记录方法执行时间
    @Value("${function.time}")
    private boolean isRecord;

    @Value("${id.datacenterid}")
    private long dataCenterId;
    @Value("${id.machineid}")
    private long machineId;

    public void afterPropertiesSet() {

        YmlConstants.setIsRecord(isRecord);

        YmlConstants.setDataCenterId(dataCenterId);
        YmlConstants.setMachineId(machineId);
    }

}
